/*
 * @Author: yangrongxin
 * @Date: 2021-08-16 10:21:20
 * @LastEditors: yangrongxin
 * @LastEditTime: 2021-08-16 14:33:46
 */
import { View, Text } from '@tarojs/components';
import styles from './index.module.less';

interface IUserInfoItemProps {
  title: string; // 标题
  rightText?: string; // 右侧展示的文本内容
  rightContent?: any; // 右侧展示的组件内容
  onClick?: any; // 点击标签的事件
}

const UserInfoItem = (props: IUserInfoItemProps) => {
  const { title = '姓名', rightText, rightContent, onClick } = props;

  return (
    <View className={styles.container} onClick={onClick}>
      <View className={styles.header}>
        <Text>{title}</Text>
      </View>
      <View className={styles.content}>{rightText ? <Text>{rightText}</Text> : rightContent}</View>
    </View>
  );
};

export default UserInfoItem;
